cmake_minimum_required(VERSION 3.6)

project(muMain74_asm C CXX ASM_MASM)

include(FindPkgConfig)

set(AdditionalIncludeDirectories CACHE PATH "")
set(AdditionalLibraryDirectories CACHE PATH "")
set(AdditionalLibrary CACHE FILEPATH "")

# asm include dir
set(masm32_inc_dir "d:/masm32/include" CACHE PATH "")

# stb include dir
pkg_check_modules(V_STB stb)
set(stb_inc_dir ${V_STB_PREFIX} CACHE PATH "")

# asm
file(GLOB asm_files asm/*.asm asm/*.inc)
source_group("asm" FILES ${asm_files})

# src
file(GLOB src_files src/*.cpp src/*.h)
source_group("src" FILES ${src_files})

# audio
file(GLOB tmp_files src/audio/*.cpp src/audio/*.h)
source_group("src\\auido" FILES ${tmp_files})
list(APPEND src_files ${tmp_files})

# base
file(GLOB tmp_files src/base/*.cpp src/base/*.h)
source_group("src\\base" FILES ${tmp_files})
list(APPEND src_files ${tmp_files})

# math
file(GLOB tmp_files src/math/*.cpp src/math/*.h)
source_group("src\\math" FILES ${tmp_files})
list(APPEND src_files ${tmp_files})

# network
file(GLOB tmp_files src/network/*.cpp src/network/*.h)
source_group("src\\network" FILES ${tmp_files})
list(APPEND src_files ${tmp_files})

# renderer
file(GLOB tmp_files src/renderer/*.cpp src/renderer/*.h)
source_group("src\\renderer" FILES ${tmp_files})
list(APPEND src_files ${tmp_files})

# terrain
file(GLOB tmp_files src/terrain/*.cpp src/terrain/*.h)
source_group("src\\terrain" FILES ${tmp_files})
list(APPEND src_files ${tmp_files})

# ui
file(GLOB tmp_files src/ui/*.cpp src/ui/*.h)
source_group("src\\ui" FILES ${tmp_files})
list(APPEND src_files ${tmp_files})

# utils
file(GLOB tmp_files src/utils/*.cpp src/utils/*.h)
source_group("src\\utils" FILES ${tmp_files})
list(APPEND src_files ${tmp_files})

# scene
file(GLOB tmp_files src/scene/*.cpp src/scene/*.h)
source_group("src\\scene" FILES ${tmp_files})
list(APPEND src_files ${tmp_files})

include_directories(src ${AdditionalIncludeDirectories} ${stb_inc_dir} ${masm32_inc_dir})
link_directories(${AdditionalLibraryDirectories})
link_libraries(${AdditionalLibrary})

add_compile_options(/wd4996 /wd4018 /wd4244)
add_link_options("/SAFESEH:NO")
add_executable(${PROJECT_NAME} WIN32 ${asm_files} ${src_files})
